<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">


<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>
    







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">





 
<script> (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice") 
 daovoice('init', {
  app_id: "96f0995d"
});
daovoice('update');
  </script> 

 





<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="matlab,">





  <link rel="alternate" href="/atom.xml" title="Hoganbin's Blog" type="application/atom+xml">






<meta name="description" content="写在前面还有半个来月美赛，八一便写篇maltab全教程，本文适用于完全没有任何matlab基础的学生看，但同时也可以给那些曾对matlab熟悉的同学进行回忆。。。一般常用的数学软件有Maple，Mathematica，Matlab等；常用的大型统计软件有SAS，SPSS，hadoop等。下面我主要介绍一些Matlab的教程。">
<meta name="keywords" content="matlab">
<meta property="og:type" content="article">
<meta property="og:title" content="八一讲解matlab的完整教程">
<meta property="og:url" content="https://hoganbin.top/post/20036/index.html">
<meta property="og:site_name" content="Hoganbin&#39;s Blog">
<meta property="og:description" content="写在前面还有半个来月美赛，八一便写篇maltab全教程，本文适用于完全没有任何matlab基础的学生看，但同时也可以给那些曾对matlab熟悉的同学进行回忆。。。一般常用的数学软件有Maple，Mathematica，Matlab等；常用的大型统计软件有SAS，SPSS，hadoop等。下面我主要介绍一些Matlab的教程。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkcixg1rj30qg0jhwfv.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkep2ab9j30u00glgo7.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkih16cpj30u00gvgnr.jpg">
<meta property="og:image" content="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkj15rnfj30rw0dgab6.jpg">
<meta property="og:updated_time" content="2019-05-08T02:47:45.488Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="八一讲解matlab的完整教程">
<meta name="twitter:description" content="写在前面还有半个来月美赛，八一便写篇maltab全教程，本文适用于完全没有任何matlab基础的学生看，但同时也可以给那些曾对matlab熟悉的同学进行回忆。。。一般常用的数学软件有Maple，Mathematica，Matlab等；常用的大型统计软件有SAS，SPSS，hadoop等。下面我主要介绍一些Matlab的教程。">
<meta name="twitter:image" content="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkcixg1rj30qg0jhwfv.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"输入关键字","hits_empty":"没有找到与文章相关的内容","hits_stats":"${hits}条相关记录，共耗时${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hoganbin.top/post/20036/">




  <title>八一讲解matlab的完整教程 | Hoganbin's Blog</title>
  








</head>


<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

   <a href="https://http://hoganbin.coding.me"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
  
   <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      
    <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Hoganbin's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">不忘初心，记录时光，走向成长。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-address-card"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-envelope"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-photo">
          <a href="/photo/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-image"></i> <br>
            
            照片
          </a>
        </li>
      
        
        <li class="menu-item menu-item-book">
          <a href="/book/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br>
            
            书影音
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://hoganbin.top/post/20036/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Hoganbin">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hoganbin's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">八一讲解matlab的完整教程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-08T22:01:07+08:00">
                2019-01-08
              </time>
            

            

            
          </span>

        
        <span id="busuanzi_container_page_pv">&nbsp;&nbsp;|&nbsp;&nbsp;阅读量 <span id="busuanzi_value_page_pv"></span> 次</span>
        

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/编程/" itemprop="url" rel="index">
                    <span itemprop="name">编程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/post/20036/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/post/20036/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
            </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  2.7k
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  11
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h2><p>还有半个来月美赛，八一便写篇maltab全教程，本文适用于完全没有任何matlab基础的学生看，但同时也可以给那些曾对matlab熟悉的同学进行回忆。。。一般常用的数学软件有<code>Maple，Mathematica，Matlab</code>等；常用的大型统计软件有<code>SAS，SPSS，hadoop</code>等。下面我主要介绍一些Matlab的教程。</p>
<a id="more"></a>
<p>Matlab有五大通用功能：数值计算(Numeric)，符号运算(Symbolic)，数据可视化(Graphic)，数据图形文字统一处理(Notebook)和建模仿真可视化(Simulink)。它在线性代数，矩阵分析，数值计算及优化问题，还包括数理统计和随机信号分析，电路与系统，建模和仿真等众多领域的理论研究和工程设计中得到了广泛应用。它是1984年由美国Mathworks 公司推向市场。该软件有三大特点：一是功能强大；二是界面友善，语言自然；三是开放性强。Matlab的版本目前是Matlab2018。</p>
<p>#matlab简介介绍</p>
<p>首先我们要认识下什么m文件，有三点：(1)如果我们想灵活应用matlab去解决实际问题，充分调用matlab的科学技术资源，就需要编辑m文件；(2)包含matlab语言代码的文件称为m文件，其扩展名为m；(3)编辑m文件可使用各种文本编辑器。然后将matlab语句构成的程序存储成以m为扩展名的文件，然后再执行该程序文件，这种工作模式称为程序文件模式。一般m文件的语法类似于c语言，但又有其自身特点。它只是一个简单的ASCII码文本文件，执行程序时逐行解释运行程序，matlab是解释性的编程语言。</p>
<p><strong>m文件有两类</strong></p>
<ul>
<li>独立的m文件 — 称命令文件：实际上是一串指令的集合，与在命令窗口逐行执行文件中的所有指令，其结果是一样的。没有输入输出参数。</li>
</ul>
<p><strong>命令文件包括两部分：注释文件和程序文件</strong></p>
<figure class="highlight plain"><figcaption><span>Number of linearly independent rows or columns.</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">% K = RANK(X) is the number of singular values of X</span><br><span class="line">% that are larger than MAX(SIZE(X)) * NORM(X) * EPS.</span><br><span class="line">% K = RANK(X,tol) is the number of singular values of X that</span><br><span class="line">% are larger than tol.</span><br><span class="line">% Copyright (c) 1984-94 by The MathWorks, Inc.</span><br><span class="line">s = svd(x);</span><br><span class="line">if (nargin == 1)</span><br><span class="line">    tol = max(size(x)) * max(s) * eps;</span><br><span class="line">end</span><br><span class="line">r = sum(s &gt; tol);</span><br></pre></td></tr></table></figure>
<ul>
<li>调用m文件 — 称函数文件：matlab自定义的函数文件称内置函数文件调用内置函数的方法：使用函数名并给出相应的入口、出口参数即可。例如：sin.m函数——用type sin查不到。调用格式：y=sin(2*x) 实际应用中：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">x=0:2*pi/180:2*pi;</span><br><span class="line">   y=sin(2*x)</span><br><span class="line">   plot(x,y)</span><br></pre></td></tr></table></figure>
<p><code>matlab语言的程序结构与其它高级语言是一致的，分为顺序结构，循环结构，分支结构。</code></p>
<ul>
<li><p>顺序结构—— 依次顺序执行程序的各条语句；</p>
</li>
<li><p>循环结构 —— 被重复执行的一组语句，循环是计算机解决问题的主要手段。 循环语句主要有：(1)for -end（中间为可执行语句）；(2)while -end；(3)分支结构（if — else — end语句有3种形式，用elseif可替代一般高级语言中的switch-case-end语句）</p>
</li>
<li><p>在条件表达式中，通常都是由</p>
<ul>
<li><p>关系操作符 &gt;, &lt; ,&lt;=, &gt;=, = =, ~= 等</p>
</li>
<li><p>逻辑操作符 &amp;，| ， ~等</p>
</li>
<li><p>逻辑函数：isequal —— 若是相等则为真；isempty ——若是空矩阵则为真；isstr —— 若是字符串则为真。</p>
<p>Matlab 运算符分五类：数学、关系，逻辑、位、集合</p>
<p><code>数学运算符：是进行各种数学运算，按其优先级别依次为</code></p>
</li>
</ul>
</li>
<li><p>转置.’、共轭转置’、幂次.、矩阵幂次^</p>
</li>
<li>正、负号+、-</li>
<li>乘法.、矩阵乘法、元素左右除.\、./、矩阵左右除\、/</li>
<li>加减法+、-</li>
<li><p>冒号:在同一优先级中，运算自左至右完成，对运算顺序不确定时，最好以 “()” 实现强制运算顺序.<br>对于矩阵，右除A/B，相当于XB=A 的解矩阵，左除A\B，相当于AX=B 的解矩阵</p>
</li>
<li><h5 id="关系运算符：有六种关系运算符-，-，-gt-，-gt-，-lt-，-lt"><a href="#关系运算符：有六种关系运算符-，-，-gt-，-gt-，-lt-，-lt" class="headerlink" title="关系运算符：有六种关系运算符==，~=，&gt;，&gt;=，&lt;，&lt;="></a>关系运算符：有六种关系运算符==，~=，&gt;，&gt;=，&lt;，&lt;=</h5><p>关系运算符总是以矩阵内元素对元素做运算，若满足关系，则返回 1，不满足则返回 0</p>
<h5 id="逻辑运算符：有三种：-amp-（与），-（或），-（非）"><a href="#逻辑运算符：有三种：-amp-（与），-（或），-（非）" class="headerlink" title="逻辑运算符：有三种：&amp;（与），|（或），~（非）"></a>逻辑运算符：有三种：&amp;（与），|（或），~（非）</h5><p>相关命令还有：all()，any()。当所有向量元素为 “真”，all 返回 1，而当任意元素为 “真”，any 即返回 1</p>
<h5 id="位运算符：对非负整数的逻辑运算，主要函数如下"><a href="#位运算符：对非负整数的逻辑运算，主要函数如下" class="headerlink" title="位运算符：对非负整数的逻辑运算，主要函数如下"></a>位运算符：对非负整数的逻辑运算，主要函数如下</h5><ul>
<li>bitand()：位对位 AND</li>
<li>bitor()：位对位 OR</li>
<li>bitxor()：位对位异或</li>
<li>bitset()：设定某位</li>
<li>bitget()：取得某位</li>
<li>bitcmp()：位对位取反</li>
<li>bitshift()：位移（左移）</li>
</ul>
<h5 id="集合运算符：仅限于向量运算，此时-matlab-将向量视为集合来进行各种集合运算，常用命令如下"><a href="#集合运算符：仅限于向量运算，此时-matlab-将向量视为集合来进行各种集合运算，常用命令如下" class="headerlink" title="集合运算符：仅限于向量运算，此时 matlab 将向量视为集合来进行各种集合运算，常用命令如下"></a>集合运算符：仅限于向量运算，此时 matlab 将向量视为集合来进行各种集合运算，常用命令如下</h5><ul>
<li>Union()：并集</li>
<li>intersect()：交集</li>
<li>setdiff()：差集</li>
<li>setxor()：异或</li>
<li>unique()：最小等效集合</li>
<li>ismember()：元素是否属于集合</li>
</ul>
<p>#matlab自定义函数</p>
</li>
</ul>
<figure class="highlight plain"><figcaption><span>i </span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(0,10,101);</span><br><span class="line">plot(x,sin(x + i));</span><br><span class="line">print(gcf,&apos;-deps&apos;,strcat(&apos;plot&apos;,num2str(i),&apos;.ps&apos;));</span><br><span class="line">end</span><br></pre></td></tr></table></figure>
<p><img src="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkcixg1rj30qg0jhwfv.jpg" alt></p>
<p>在熟练matlab过程我们需要掌握的几个常用的快捷键：</p>
<ul>
<li>%：单行注释</li>
<li>ctrl + r：多行注释</li>
<li>ctrl + t：取消多行注释</li>
<li>ctrl + i：智能缩进</li>
<li>%%：指定节</li>
<li>ctrl + enter：执行节</li>
<li>f5：运行程序</li>
</ul>
<p>然后举个LMS算法例子来创建第一个Matlab function，来看</p>
<p><img src="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkep2ab9j30u00glgo7.jpg" alt></p>
<p>#matlab绘图</p>
<p>强大的绘图功能是Matlab的特点之一，Matlab提供了一系列的绘图函数，用户不需要过多的考虑绘图的细节，只需要给出一些基本参数就能得到所需图形，这类函数称为高层绘图函数。此外，Matlab还提供了直接对图形句柄进行操作的低层绘图操作。这类操作将图形的每个图形元素（如坐标轴、曲线、文字等）看做一个独立的对象，系统给每个对象分配一个句柄，可以通过句柄对该图形元素进行操作，而不影响其他部分。</p>
<p><strong>绘图语法</strong></p>
<figure class="highlight plain"><figcaption><span>%创建 Y 中数据对 X 中对应值的二维线图。</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">plot(X,Y,LineSpec) %设置线型、标记符号和颜色。</span><br><span class="line">plot(X1,Y1,…,Xn,Yn) %绘制多个 X、Y 对组的图，所有线条都使用相同的坐标区。</span><br><span class="line">plot(X1,Y1,LineSpec1,…,Xn,Yn,LineSpecn) %设置每个线条的线型、标记符号和颜色。</span><br><span class="line">plot(Y) %创建 Y 中数据对每个值索引的二维线图。</span><br><span class="line">plot(Y,LineSpec) %设置线型、标记符号和颜色。</span><br><span class="line">plot(_,Name,Value) %使用一个或多个 Name,Value 对组参数指定线条属性。</span><br><span class="line">plot(ax,_) %将在由ax指定的坐标区中，而不是在当前坐标区 (gca) 中创建线条。</span><br><span class="line">h = plot(_) %回由图形线条对象组成的列向量。</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 1.创建线图</span><br></pre></td></tr></table></figure>
<p>x = 0:pi/100:2*pi;<br>y = sin(x);<br>plot(x,y)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">![](https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkg8hhcpj30ds0ap74d.jpg)</span><br><span class="line"></span><br><span class="line">- 2.绘制多个线条</span><br></pre></td></tr></table></figure></p>
<p>x = linspace(-2<em>pi,2</em>pi);<br>y1 = sin(x);<br>y2 = cos(x);<br>figure<br>plot(x,y1,x,y2)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 3.指定线型</span><br></pre></td></tr></table></figure></p>
<p>x = 0:pi/100:2*pi;<br>y1 = sin(x);<br>y2 = sin(x-0.25);<br>y3 = sin(x-0.5);</p>
<p>figure<br>plot(x,y1,x,y2,’–’,x,y3,’:’)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 4.指定线型、颜色和标记</span><br></pre></td></tr></table></figure></p>
<p>x = 0:pi/10:2<em>pi;<br>y1 = sin(x);<br>y2 = sin(x-0.25);<br>y3 = sin(x-0.5);<br>figure<br>plot(x,y1,’g’,x,y2,’b–o’,x,y3,’c</em>‘)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 5.指定线宽、标记大小和标记颜色</span><br></pre></td></tr></table></figure></p>
<p>x = -pi:pi/10:pi;<br>y = tan(sin(x)) - sin(tan(x));</p>
<p>figure<br>plot(x,y,’–gs’,…<br>‘LineWidth’,2,…<br>‘MarkerSize’,10,…<br>‘MarkerEdgeColor’,’b’,…<br>‘MarkerFaceColor’,[0.5,0.5,0.5])<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 6.添加标题和轴标签</span><br></pre></td></tr></table></figure></p>
<p>x = linspace(0,10,150);<br>y = cos(5*x);<br>figure<br>plot(x,y,’Color’,[0,0.7,0.9])<br>title(‘2-D Line Plot’)<br>xlabel(‘x’)<br>ylabel(‘cos(5x)’)<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 7.创建并修改线条</span><br></pre></td></tr></table></figure></p>
<p>x = linspace(-2<em>pi,2</em>pi);<br>y1 = sin(x);<br>y2 = cos(x);<br>p = plot(x,y1,x,y2);<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">**。。。。省略若干**</span><br><span class="line"></span><br><span class="line">#matlab在数学建模的应用</span><br><span class="line"></span><br><span class="line">## `一.人口预测模型`</span><br><span class="line"></span><br><span class="line">例1：下表1-4是某地区1971一2000年的人口数据，试给出该地区人口增长的数学模型。根据表中的数据做出其散点图，从可以看出，人口随时间的变化呈非线性过程，而且存在一个与横坐标轴平行的渐近线，故可以用Logistic曲线模型进行拟合。</span><br><span class="line"></span><br><span class="line">![](https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkhnaxw6j30mk0f2tac.jpg)</span><br><span class="line"></span><br><span class="line">`建立个population.m文件，由于logistic曲线模型形式为y=1/(a+be^-t)，所以这里我们只要假设y*=1/y，x*=e^-t，就可以将其转化直线模型y*=a+bx*，即可编写拟合程序如下。`</span><br><span class="line"></span><br><span class="line">```clear</span><br><span class="line">clc</span><br><span class="line">% 读入人口数据（1971－2000年）</span><br><span class="line">Y=[33815    33981   34004   34165   34212   34327   34344   34458   34498   34476   34483   34488   34513   34497   34511   34520   34507   34509   34521   34513   34515   34517   34519   34519   34521   34521   34523   34525   34525   34527]</span><br><span class="line">% 读入时间变量数据（t＝年份－1970）</span><br><span class="line">T=[1    2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30]</span><br><span class="line">% 线性化处理</span><br><span class="line">for t = 1:30, </span><br><span class="line">   x(t)=exp(-t);</span><br><span class="line">   y(t)=1/Y(t);</span><br><span class="line">end</span><br><span class="line">% 计算，并输出回归系数B</span><br><span class="line">c=zeros(30,1)+1;</span><br><span class="line">X=[c,x&apos;];</span><br><span class="line">B=inv(X&apos;*X)*X&apos;*y&apos;</span><br><span class="line">for i=1:30,</span><br><span class="line">% 计算回归拟合值    </span><br><span class="line">    z(i)=B(1,1)+B(2,1)*x(i);</span><br><span class="line">% 计算离差</span><br><span class="line">    s(i)=y(i)-sum(y)/30;</span><br><span class="line">% 计算误差    </span><br><span class="line">    w(i)=z(i)-y(i);</span><br><span class="line">end</span><br><span class="line">% 计算离差平方和S</span><br><span class="line">S=s*s&apos;;</span><br><span class="line">% 回归误差平方和Q</span><br><span class="line">Q=w*w&apos;;</span><br><span class="line">% 计算回归平方和U</span><br><span class="line">U=S-Q;</span><br><span class="line">% 计算，并输出F检验值</span><br><span class="line">F=28*U/Q</span><br><span class="line">% 计算非线性回归模型的拟合值</span><br><span class="line">for j=1:30,</span><br><span class="line">    Y(j)=1/(B(1,1)+B(2,1)*exp(-j));</span><br><span class="line">end</span><br><span class="line">% 输出非线性回归模型的拟合曲线（Logisic曲线）</span><br><span class="line">plot(T,Y)</span><br></pre></td></tr></table></figure></p>
<p><code>`</code></p>
<p><img src="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkih16cpj30u00gvgnr.jpg" alt></p>
<h2 id="二-灰色预测模型"><a href="#二-灰色预测模型" class="headerlink" title="二.灰色预测模型"></a><code>二.灰色预测模型</code></h2><p>例2：下面以某公司收入预测问题为例介绍灰色预测的MATLAB实现过程。<br>已知某公司1999-2008年的利润为（单位：元/年）：[89677，99215，109655，120333，135823，</p>
<p>159878，182321，209407，246619，300670]</p>
<p>现在要预测该公司未来几年的利润情况。</p>
<p><code>分析：首先说明下，在建立灰色预测模型之前，需先对原始时间序列进行数据处理，经过数据处理后的时间序列即称为生成列。灰色系统常用的数据处理方式有累加和累减两种。其实灰色预测的思路非常简单，就是通过一组数据序列进行累加建立的线性微分方程，其中系数便为发展系数与灰色作用量，那么只需要求参便可以预测未来值，这里采用了对累加数据进行均值生成矩阵向量，采用最小二乘法即可，且最后作残差处理，便可建立，具体程序见如下:</code></p>
<p><img src="https://ws1.sinaimg.cn/large/005I3Cc4gy1fyzkj15rnfj30rw0dgab6.jpg" alt></p>
<p>模型太多，八一不多说，自己参考相关书籍</p>
<p>#matlab参考书籍</p>
<ul>
<li>《MATLAB R2016a完全自学一本通》</li>
<li>《MATLAB宝典》</li>
<li>《MATLAB数值计算》</li>
<li>《MATLAB揭秘》</li>
<li>《MATLAB在数学建模中的应用》</li>
<li>《MATLAB从入门到精通》</li>
<li>《MATLAB函数速查手册》</li>
</ul>

      
    </div>
    
    
    
    
      <div>
    
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>
     
      </div>
      
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>分享知识，学会生活，坚持原创！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.png" alt="Hoganbin 微信支付">
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="Hoganbin 支付宝">
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    Hoganbin |  微信公众号【八一考研数学竞赛】
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://hoganbin.top/post/20036/" title="八一讲解matlab的完整教程">https://hoganbin.top/post/20036/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh" rel="external nofollow" target="_blank">CC BY-NC-ND 4.0</a> 许可协议。转载请注明出处！
  </li>
  <li class="post-copyright-license">
    并保留本声明和上方二维码。感谢您的阅读和支持！
  </li>
</ul>
      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/matlab/" rel="tag"># matlab</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/post/45733/" rel="next" title="第十届全国大学生数学竞赛LaTeX模板">
                <i class="fa fa-chevron-left"></i> 第十届全国大学生数学竞赛LaTeX模板
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/post/4314/" rel="prev" title="2019年985院校数分高代与历年真题解析">
                2019年985院校数分高代与历年真题解析 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript">
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="uyan_frame"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/avatar.png" alt="Hoganbin">
            
              <p class="site-author-name" itemprop="name">Hoganbin</p>
              <p class="site-description motion-element" itemprop="description">既然选择了远方，又何惧风雨兼程</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">39</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">23</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/hoganbin" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/hoganbin/activities" target="_blank" title="Zhihu">
                      
                        <i class="fa fa-fw fa-align-justify"></i>Zhihu</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://math.stackexchange.com/" target="_blank" title="MSE">
                      
                        <i class="fa fa-fw fa-map"></i>MSE</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://outlook.live.com/mail/inbox" target="_blank" title="Mail">
                      
                        <i class="fa fa-fw fa-envelope-square"></i>Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://tool.hoganbin.top/" target="_blank" title="tool">
                      
                        <i class="fa fa-fw fa-crosshairs"></i>tool</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5231684748/profile?topnav=1&wvr=6&is_all=1" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-globe"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.ruanyifeng.com/home.html" title="阮一峰" target="_blank">阮一峰</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.yinwang.org/" title="王银" target="_blank">王银</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://cherryblog.site/" title="Cherryblog" target="_blank">Cherryblog</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.wmathor.com/" title="Wmathor" target="_blank">Wmathor</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.icyuyan.net/" title="独孤伶俜的博客" target="_blank">独孤伶俜的博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://afeiai.cn/" title="小罗的博客" target="_blank">小罗的博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.dotcpp.com/" title="C语言网" target="_blank">C语言网</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://io.backrunner.top/" title="技术空间" target="_blank">技术空间</a>
                  </li>
                
              </ul>
            </div>
          
          <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=254359&auto=0&height=66"></iframe>

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#写在前面"><span class="nav-number">1.</span> <span class="nav-text">写在前面</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#关系运算符：有六种关系运算符-，-，-gt-，-gt-，-lt-，-lt"><span class="nav-number">1.0.0.1.</span> <span class="nav-text">关系运算符：有六种关系运算符==，~=，&gt;，&gt;=，&lt;，&lt;=</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#逻辑运算符：有三种：-amp-（与），-（或），-（非）"><span class="nav-number">1.0.0.2.</span> <span class="nav-text">逻辑运算符：有三种：&amp;（与），|（或），~（非）</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#位运算符：对非负整数的逻辑运算，主要函数如下"><span class="nav-number">1.0.0.3.</span> <span class="nav-text">位运算符：对非负整数的逻辑运算，主要函数如下</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#集合运算符：仅限于向量运算，此时-matlab-将向量视为集合来进行各种集合运算，常用命令如下"><span class="nav-number">1.0.0.4.</span> <span class="nav-text">集合运算符：仅限于向量运算，此时 matlab 将向量视为集合来进行各种集合运算，常用命令如下</span></a></li></ol></li></ol><li class="nav-item nav-level-2"><a class="nav-link" href="#二-灰色预测模型"><span class="nav-number">2.</span> <span class="nav-text">二.灰色预测模型</span></a></li></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 

<span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hoganbin</span>
 
 <span class="post-meta-divider">|</span>
<span id="sitetime"> <br></span>
<script language="javascript">
  function siteTime(){
    window.setTimeout("siteTime()", 1000);
    var seconds = 1000
    var minutes = seconds * 60
    var hours = minutes * 60
    var days = hours * 24
    var years = days * 365
    var today = new Date()
    var todayYear = today.getFullYear()
    var todayMonth = today.getMonth()
    var todayDate = today.getDate()
    var todayHour = today.getHours()
    var todayMinute = today.getMinutes()
    var todaySecond = today.getSeconds()
    var t1 = Date.UTC(2018,3,13,11,00,00)
    var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond)
    var diff = t2-t1
    var diffYears = Math.floor(diff/years)
    var diffDays = Math.floor((diff/days)-diffYears*365)
    var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours)
    var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes)
    var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds)
    document.getElementById("sitetime").innerHTML=" 本站已运行"+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒<br>"
  }
  siteTime()

</script>


 <div class="footer-custom">你看得到我打在屏幕上的字，却看不到我落在键盘上的泪</div>


<div class="busuanzi-count">
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv" title="访问人数"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv">&nbsp;</span>人次</span>
  
    <span title="总字数"> <i class="fa fa-edit"></i>&ensp;<span class="post-count">博客全站共38.2k字</span>
    
    <span class="post-meta-divider">|</span>
    <span class="site-pv" title="总访问量"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv">&nbsp;</span>次</span>
  
</span></div>







  
</div>



  <span class="post-meta-divider"></span>






        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<!--  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>

  
  -->
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  
    

    
      <!-- UY BEGIN -->
      <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=2161245"></script>
      <!-- UY END -->
    
  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: 'GwtyLTw1Vqh9Y97KIRMNJBrl-gzGzoHsz',
        appKey: 'cibt8H2bgkTOqn1pUH5v0WxQ',
        placeholder: '说点什么吗？',
        avatar:'mm',
        guest_info:['nick','mail','link'] ,// 评论只需要提供昵称
        pageSize:'10' || 10,
    });
  </script>



  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

  

  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>

